﻿@{
    ViewBag.Title = "LendrsList";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using P2PWeb;
@using P2PWeb.Common;

<script type="text/javascript" src="@Url.Content("~/Scripts/app/pager.js")"></script>
<link href="@Url.Content("~/Content/LendrsList_Style.css")" rel="stylesheet" type="text/css" />

<script type="text/javascript">
    //tab页集合
    var tabs = ["All", "Success", "Raise"];
    //默认显示的tab
    var tab = "All";

    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)
            return unescape(r[2]);
        return null;
    }

    //根据tab请求ajax数据
    function GetData(url) {
        //搜索的参数
        var iapproveNo = $("#iapproveNo").val();//期限
        var currRate = $("#currRate").val();//年利率
        var iapproveAmt = $("#iapproveAmt").val();//金额

        $(".tabs li").each(function (i) {
            $(this).removeClass('active');
            if (tab == tabs[i]) {
                $(this).addClass('active');
                $.ajax({
                    type: "get",
                    url: url,
                    data: { tab: tab, iapproveNo: iapproveNo, currRate: currRate, iapproveAmt: iapproveAmt },
                    success: function (data) {
                        $("#showData").html(data);
                    }
                })
            }
        });
    }

    $(function () {
        //绑定tab页
        $(".tabs li").each(function (i) {
            $(this).children("a").attr("href", "javascript:");
            $(this).click(function () {
                tab = tabs[i];
                GetData("/Lenders/View1");
            });
        });
        //搜索
        $("#btnSearch").click(function () {
            GetData("/Lenders/Search");
        });
        //重置
        $("#btnReset").click(function () {
            $("#iapproveNo").val("-1");
            $("#currRate").val("-1");
            $("#iapproveAmt").val("-1");
        });
        //年利率后面的提示
        $('a.askIcon').each(function () {
            $(this).mouseover(function () {
                $(this).prev().css('display', 'block');
            });

            $(this).mouseleave(function () {
                $(this).prev().css('display', 'none');
            });
        });



    });
</script>

<div style="width: 929px; height: 155px; margin-right: auto; margin-bottom: 18px; margin-left: auto;">
    <a href="/">
       @* <img width="929" height="155" src="/Images/b_s1.jpg" />*@
    </a>
</div>
<div class="main">
    <div class="main_top"><span class="main_top_right"></span></div>
    <div class="main_box pt0 pb0 pl30 pr30 clearfix">
        <div class="container">
            <ul class="tabs">
                <li class="tabs_first active"><a href="#">全部借款</a></li>
                <li><a href="#">已成功借款</a></li>
                <li><a href="#">正在筹款</a></li>
            </ul>
            <div class="tab_container">
                <div class="tab_content">
                    <div class="tab_search">
                        <span class="tab_search_icon png"></span>
                        <div class="tab_search_area">
                            <fieldset>
                                <label for="iapproveNo">期限：</label>
                                <select id="iapproveNo" name="iapproveNo">
                                    <option value="-1">不限</option>
                                    <option value="12">12个月</option>
                                    <option value="18">18个月</option>
                                    <option value="24">24个月</option>
                                    <option value="36">36个月</option>
                                </select>
                                <label for="currRate">年利率：</label>
                                <select id="currRate" name="currRate">
                                    <option value="-1">不限</option>
                                    <option value="0.10">10%</option>
                                    <option value="0.12">12%</option>
                                    <option value="0.14">14%</option>
                                    <option value="0.16">16%</option>
                                </select>
                                <label for="iapproveAmt">金额：</label>
                                <select id="iapproveAmt" name="iapproveAmt" class="selLong">
                                    <option value="-1">不限</option>
                                    <option value="5">1-5万</option>
                                    <option value="10">5-10万</option>
                                    <option value="20">10-20万</option>
                                    <option value="30">20-30万</option>
                                    <option value="40">30-40万</option>
                                    <option value="50">40-50万</option>
                                </select>

                                <input id="btnSearch" type="submit" value="搜索" class="gray_btn hand gray_btn_ie6">
                                <input id="btnReset" type="reset" class="gray_btn hand gray_btn_ie6" value="重置" />
                            </fieldset>
                        </div>
                    </div>

                    <div id="showData">
                        <input id="hidtab" type="hidden" value="" />
                        @RenderPage("View1.cshtml")
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="main_bottom"><span class="main_bottom_right"></span></div>
</div>

